﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ADDDF.Infrastructure.Collections
{
    public class EntitySetOperationEventArgs : EventArgs
    {
        private string _opName;
        private bool _cancel;

        public EntitySetOperationEventArgs(string opName)
        {
            _opName = opName;
        }

        public string OpName
        {
            get { return _opName; }
        }

        public bool Cancel
        {
            get { return _cancel; }
            set { _cancel = value; }
        }
    }

    public class AddAndReplaceEntityEventArgs : EntitySetOperationEventArgs
    {
        private IEntity _item;

        public AddAndReplaceEntityEventArgs(IEntity item)
            : base("AddAndReplace")
        {
            _item = item;
        }

        public IEntity Item
        {
            get { return _item; }
        }
    }

    public class RemoveEntityEventArgs : EntitySetOperationEventArgs
    {
        private IEntity _item;

        public RemoveEntityEventArgs(IEntity item)
            : base("Remove")
        {
            _item = item;
        }

        public IEntity Item
        {
            get { return _item; }
        }
    }

    public class RemoveAllEntitiesEventArgs : EntitySetOperationEventArgs
    {
        public RemoveAllEntitiesEventArgs()
            : base("RemoveAll")
        {
        }
    }
}
